package com.yy.homework_;

/**
 * chapter12  com.yy.homework_
 * 2023-05-12 22:58
 *
 * @author yy yuyue
 * description : 不可描述
 * @date 2023/5/12 22:58
 */
public class AAA {
    int x;//默认为0
    public static void main(String[] args) {
        String[] friends = {"thy","qc","lxh"};
        for (int i = 0; i < 4; i++) {
            System.out.println(friends[i]);//出现ArrayIndexOutOfBoundsException
        }
        int y = 0;
        AAA a = new AAA();
        y = 3/a.x;//ArithmeticException
        System.out.println(" program ends ok!");

    }
}

class Cat{
   private String name;



//    public static void main(String[] args) {
//        Cat cat = new Cat();
//        cat = null;
//        System.out.println(cat.name);//出现NullPointerException
//    }
}
class Person{
    public static void main(String[] args) {
        Object obj = new Object();
        Person person;
        person = (Person)obj;
        System.out.println(person);//出现ClassCastException


    }
}